var tempWindow = null;


/**
 * 開啟視窗
 */
function openWindowBySimple( pageName, width, height, message )
{
	openWindow( pageName, width, height, 'no', 'no', message );
}

/**
 * 開啟視窗
 */
function openWindow( pageName, width, height, scroll, resizable, message )
{
	var tempWidth = width;
	var tempHeight = height;
	var tempLeft = ( screen.width - width ) / 2;
	var tempTop = ( screen.height - height ) / 2;
	
	var feature = "width=" + tempWidth;
	feature += ", height=" + tempHeight;
	feature += ", left=" + tempLeft;
	feature += ", top=" + tempTop;
	feature += ", menubar=no";
	feature += ", scrollbars=" + scroll;
	feature += ", resizable=" + resizable;
	
	if( tempWindow == null )
	{
		tempWindow = window.open( pageName, "", feature );
	}
	else
	{
		alert( message );
	}
}